<template>
	<div class="home-recommend">
		<ItemHeader linkUrl="/" title="人气推荐"/>
		<div class="home-recommend-list">
			<RecommendItem
					v-for="item in showRecommendList"
					:key="item.id"
					:recommendItem="item"
					:characteristic="false"
			/>
		</div>
	</div>
</template>

<script>
	import ItemHeader from '#/Public/ItemHeader';
	import RecommendItem from '#/Public/RecommendItem';

	export default {
		name: "Recommend",
		props: {
			recommendList: {
				type: Array,
				default: []
			}
		},
		computed: {
			showRecommendList() {
				let list = [...this.recommendList];
				list = list.filter(item => item.recommendStatus === 1);
				list.splice(4);
				return list;
			}
		},
		components: {
			ItemHeader,
			RecommendItem
		}
	}
</script>
